<template>
    <div id='auth-apply-detail'>
       <!--  <h1 class="card-title">
           <span>审核详情</span>
       </h1> -->
        
        <div class="loading-min-height">
            <loading v-show='loading' mode='full'></loading>
            <transition name='fade'>
                <div class="result-info" v-if='!loading'>
                    <div class="detail-info">
                        <p>审核状态: <span>{{info.statusStr || placeholder}}</span></p>
                        <p>专属客服: <span>{{info.operator || placeholder}}</span></p>
                        <!-- <p class='red'>黑名单: <span>{{info.report && info.report.blackReport || placeholder}}</span></p> -->
                        <div class='green zmxy'>
                            <span>
                                芝麻信用分: 
                                {{info.report && info.report.zhimaScore || placeholder}} 
                                {{info.report && info.report.isCheckedStr || placeholder}}
                            </span>
                            <div class='zmxy-button' v-if='info.report && info.report.isManual'>
                                <span 
                                    @click='checkZmxy()' 
                                    class="button auto" 
                                    :class='{disabled:info.report && info.report.isChecked}'>已核实无误</span>
                                <span 
                                    class="button auto warn" 
                                    @click='show_modal_zmxy = true'
                                    :class='{disabled:info.report && info.report.isChecked}'>已核实需修改</span>
                            </div>
                        </div>
                        <template v-if='info.report && info.report.isManual'>
                            <p>支付宝账号名: <span>{{info.report && info.report.zmAccountNumber || placeholder}}</span></p>
                            <p>支付宝密码: <span>{{info.report && info.report.zmPassword || placeholder}}</span></p>
                        </template>
                        <p>阈值: <span><i class='threshold'>机型: {{deviceConfig.device || placeholder}}</i> <i class='threshold'>芝麻分: ≥{{deviceConfig.zmScore || placeholder}}</i></span></p>
                    </div>
                    <div class="card-content">
                        <div class="sub-title"><span class="title">基础信息</span></div>
                        <ul class="result-info__list">
                            <li class="result-info__item">
                                <div class="result-info__key">姓名</div>
                                <div class="result-info__value">{{basicInfo.name || placeholder}}</div>
                            </li>
                            <li class="result-info__item">
                                <div class="result-info__key">手机号</div>
                                <div class="result-info__value">{{basicInfo.phone || placeholder}}</div>
                            </li>
                            <li class="result-info__item">
                                <div class="result-info__key">申请时间</div>
                                <div class="result-info__value">{{basicInfo.applyTime || placeholder}}</div>
                            </li>
                            <li class="result-info__item">
                                <div class="result-info__key">来源渠道</div>
                                <div class="result-info__value">{{basicInfo.source || placeholder}}</div>
                            </li>
                            <li class="result-info__item">
                                <div class="result-info__key">IP</div>
                                <div class="result-info__value">{{basicInfo.ip || placeholder}}</div>
                            </li>
                            <li class="result-info__item">
                                <div class="result-info__key">定位地址</div>
                                <div class="result-info__value">{{basicInfo.locate || placeholder}}</div>
                            </li>
                            <!-- <li class="result-info__item">
                                <div class="result-info__key">QQ</div>
                                <div class="result-info__value">{{basicInfo.qq || placeholder}}</div>
                            </li> -->
                            <!-- <li class="result-info__item">
                                <div class="result-info__key">住址</div>
                                <div class="result-info__value">{{basicInfo.address || placeholder}}</div>
                            </li> -->
                            <li class="result-info__item">
                                <div class="result-info__key">设备型号</div>
                                <div class="result-info__value">{{basicInfo.deviceModel || placeholder}}</div>
                            </li>
                            <!-- <li class="result-info__item">
                                <div class="result-info__key">婚姻状况</div>
                                <div class="result-info__value">{{basicInfo.maritalStatus || placeholder}}</div>
                            </li>
                            <li class="result-info__item">
                                <div class="result-info__key">紧急联系人1</div>
                                <div class="result-info__value">
                                    {{basicInfo.contactInfo && basicInfo.contactInfo[0].name || placeholder}}
                                    ({{basicInfo.contactInfo && basicInfo.contactInfo[0].relation || placeholder}})
                                </div>
                            </li>
                            <li class="result-info__item">
                                <div class="result-info__key">手机号</div>
                                <div class="result-info__value">
                                    {{basicInfo.contactInfo && basicInfo.contactInfo[0].phone || placeholder}}
                                </div>
                            </li>
                            <li class="result-info__item">
                                <div class="result-info__key">紧急联系人2</div>
                                <div class="result-info__value">
                                    {{basicInfo.contactInfo && basicInfo.contactInfo[1].name || placeholder}}
                                    ({{basicInfo.contactInfo && basicInfo.contactInfo[1].relation || placeholder}})
                                </div>
                            </li>
                            <li class="result-info__item">
                                <div class="result-info__key">手机号</div>
                                <div class="result-info__value">
                                    {{basicInfo.contactInfo && basicInfo.contactInfo[1].phone || placeholder}}
                                </div>
                            </li> -->
                        </ul>
                        <div class="card-warn">
                            <div class="card-warn-title">基础信息审核成果</div>
                            <div class="card-warn-select">
                                <p>基础信息是否存在明显异常</p>
                                <div class="radio">
                                    <radio-group v-model='basicStatus'>
                                        <radio :value='1' >不存在</radio>
                                        <radio :value='0' >存在</radio>
                                    </radio-group>
                                </div>
                            </div>
                            <div class="card-warn-select">
                                <p>手机号命中欺诈用户黑名单 </p>
                                <div>
                                    <span :class='{"report-warn":basicInfo.mobileRisk}'> 
                                        {{basicInfo.mobileRisk | booleanToStr}} 
                                        <template v-if='basicInfo.mobileRisk'>需上报</template> 
                                    </span>
                                </div>
                            </div>
                            <div class="card-warn-select">
                                <p>设备GPS定位命中可疑名单</p>
                                <div v-if='basicInfo.dubiousDeviceGPSRisk'>
                                    <span :class='{"report-warn":basicInfo.dubiousDeviceGPSRisk.hit}'> 
                                        {{basicInfo.dubiousDeviceGPSRisk.hit | booleanToStr}} 
                                        <template v-if='basicInfo.dubiousDeviceGPSRisk.hit'>需上报</template> 
                                    </span>
                                </div>
                            </div>
                            <div class="card-warn-select">
                                <p>设备GPS定位类似用户排查：（小于{{basicInfo.deviceGPSDistanceRisk || placeholder}}米）</p>
                                <div v-if='basicInfo.normalDeviceGPSRisk'>
                                    <span :class='{"report-warn":basicInfo.normalDeviceGPSRisk.hit}'> 
                                        {{basicInfo.normalDeviceGPSRisk.hitCount}} 
                                        <template v-if='basicInfo.normalDeviceGPSRisk.hit'>需上报</template> 
                                    </span>
                                </div>
                            </div>
                            <p class='card-warn-tips'>请检查基础信息中，是否存在明显的异常信息，包括但不限于 <br>1. IP解析地址与定位地址不一致  <br>2. 住址明显为伪造数据  <br>3. 紧急联系人姓名或手机号明显为伪造数据  <br>4. 婚姻状况为未婚时，留了紧急联系人为配偶的信息</p>
                        </div>
                    </div>

                    <div class="card-content">
                        <div class="sub-title"><span class="title">身份证信息</span></div>
                        <ul class="result-info__list">
                            <li class="result-info__item">
                                <div class="result-info__key">姓名</div>
                                <div class="result-info__value">{{idCardInfo.name || placeholder}}</div>
                            </li>
                            <li class="result-info__item">
                                <div class="result-info__key">性别</div>
                                <div class="result-info__value">{{idCardInfo.sex || placeholder}}</div>
                            </li>
                            <li class="result-info__item">
                                <div class="result-info__key">年龄</div>
                                <div class="result-info__value">
                                    {{idCardInfo.age || placeholder}}
                                    <span class='threshold'>阈值:{{deviceConfig.minAge || placeholder}} - {{deviceConfig.maxAge || placeholder}} </span>
                                </div>
                            </li>
                            <li class="result-info__item">
                                <div class="result-info__key">身份证号</div>
                                <div class="result-info__value">{{idCardInfo.idCard || placeholder}}</div>
                            </li>
                            <li class="result-info__item">
                                <div class="result-info__key">人脸识别验证</div>
                                <div class="result-info__value">{{idCardInfo.checkWay || placeholder}}</div>
                            </li>
                            <li class="result-info__item">
                                <div class="result-info__key">身份证地址</div>
                                <div class="result-info__value">{{idCardInfo.address || placeholder}}</div>
                            </li>
                        </ul>
                        <div class="idcard-pics">
                            <span class="img" @click='setCurrentImg(idCardInfo.cardFront)'><img :src="idCardInfo.cardFront"></span>
                            <span class="img" @click='setCurrentImg(idCardInfo.cardBack)'><img :src="idCardInfo.cardBack"></span>
                            <span class="img" @click='setCurrentImg(idCardInfo.cardGroup)'><img :src="idCardInfo.cardGroup"></span>
                        </div>
                        <div class="card-warn">
                            <div class="card-warn-title">身份证信息审核成果</div>
                            <div class="card-warn-select">
                                <p>身份证信息是否存在明显异常</p>
                                <div class="radio">
                                    <radio-group v-model='idCardStatus'>
                                        <radio :value='1' >不存在</radio>
                                        <radio :value='0' >存在</radio>
                                    </radio-group>
                                </div>
                            </div>
                            <div class="card-warn-select">
                                <p>身份证号命中欺诈用户黑名单 </p>
                                <div>
                                    <span :class='{"report-warn":idCardInfo.idNumberRisk}'> 
                                        {{idCardInfo.idNumberRisk | booleanToStr}} 
                                        <template v-if='idCardInfo.idNumberRisk'>需上报</template> 
                                    </span>
                                </div>
                            </div>
                            <div class="card-warn-select">
                                <p>身份证GPS定位类似用户排查：（小于{{idCardInfo.idCardGPSDistanceRisk || placeholder}}米内）</p>
                                <div v-if='idCardInfo.idAddressGPSRisk'>
                                    <span :class='{"report-warn":idCardInfo.idAddressGPSRisk.hit}'> 
                                        {{idCardInfo.idAddressGPSRisk.hitCount || 0}} 
                                        <template v-if='idCardInfo.idAddressGPSRisk.hit'>需上报</template> 
                                    </span>
                                </div>
                            </div>
                            <p class='card-warn-tips'>请检查身份证信息中，是否存在明显的异常信息，包括但不限于 <br>1. 用户上传的图片非身份证图片  <br>2. 用户上传的身份证图片模糊不清  <br>3. 用户填写的身份证信息与上传的图片不符  <br>4. 身份证正面地址与反面的签发机关不一致  <br>5. 身份证不在有效期内</p>
                        </div>
                    </div>

                    <div class="card-content">
                        <div class="sub-title"><span class="title">运营商信息</span></div>
                        <ul class="result-info__list">
                            <li class="result-info__item">
                                <div class="result-info__key">手机号</div>
                                <div class="result-info__value">{{mobileInfo.phone || placeholder}}</div>
                            </li>
                            <li class="result-info__item">
                                <div class="result-info__key">运营商</div>
                                <div class="result-info__value">{{mobileInfo.operator_zh || placeholder}}</div>
                            </li>
                            <li class="result-info__item">
                                <div class="result-info__key">归属地</div>
                                <div class="result-info__value">{{mobileInfo.phone_location || placeholder}}</div>
                            </li>
                            <li class="result-info__item">
                                <div class="result-info__key">在网时长</div>
                                <div class="result-info__value">{{mobileInfo.reg_days || placeholder}}天 
                                    <span class='threshold'>阈值:≥{{carrierConfig.onLineDay || placeholder}} </span></div>
                            </li>
                            <li class="result-info__item">
                                <div class="result-info__key">180天内活跃天数</div>
                                <div class="result-info__value">{{mobileInfo.activeDays || placeholder}}天 
                                    <span class='threshold'>阈值:≥{{carrierConfig.activeDay || placeholder}} </span></div>
                            </li>
                            <li class="result-info__item">
                                <div class="result-info__key">连续3天非活跃次数</div>
                                <div class="result-info__value">{{mobileInfo.threeDaysNoActive || placeholder}} <span class='threshold'></span></div>
                            </li>
                            <li class="result-info__item">
                                <div class="result-info__key">月均通话次数</div>
                                <div class="result-info__value">{{mobileInfo.ave_count || placeholder}} <span class='threshold'></span></div>
                            </li>
                            <li class="result-info__item">
                                <div class="result-info__key">月均话费</div>
                                <div class="result-info__value">{{mobileInfo.ave_fee || placeholder}} <span class='threshold'></span></div>
                            </li>
                            <li class="result-info__item">
                                <div class="result-info__key">通话主要活跃地区</div>
                                <div class="result-info__value">{{mobileInfo.area || placeholder}}({{mobileInfo.talkCount || placeholder}}) <span class='threshold'></span></div>
                            </li>
                            <li class="result-info__item">
                                <div class="result-info__key">互通号码数</div>
                                <div class="result-info__value">{{mobileInfo.numberCount || placeholder}} 
                                    <span class='threshold'>阈值:≥{{carrierConfig.contactNumber || placeholder}} </span></div>
                            </li>
                            <!-- <li class="result-info__item">
                                <div class="result-info__key">诈骗电话互通</div>
                                <div class="result-info__value">{{mobileInfo.mainCallAreaCount || placeholder}} <span class='threshold'></span></div>
                            </li>
                            <li class="result-info__item">
                                <div class="result-info__key">主叫</div>
                                <div class="result-info__value">{{mobileInfo.mainCallAreaCount || placeholder}} <span class='threshold'></span></div>
                            </li>
                            <li class="result-info__item">
                                <div class="result-info__key">被叫</div>
                                <div class="result-info__value">{{mobileInfo.mainCallAreaCount || placeholder}} <span class='threshold'></span></div>
                            </li> -->
                        </ul>
                        <div class="card-warn">
                            <div class="card-warn-title">运营商信息审核成果</div>
                            <div class="card-warn-select">
                                <p>运营商信息是否存在明显异常</p>
                                <div class="radio">
                                    <radio-group v-model='mobileStatus'>
                                        <radio :value='1' >不存在</radio>
                                        <radio :value='0' >存在</radio>
                                    </radio-group>
                                </div>
                            </div>
                            <div class="card-warn-select">
                                <p>通话记录号码命中欺诈用户黑名单 </p>
                                <div>
                                    <span :class='{"report-warn":mobileInfo.callRecordRisk}'> 
                                        {{mobileInfo.callRecordRisk | booleanToStr}} 
                                        <template v-if='mobileInfo.callRecordRisk'>需上报</template> 
                                    </span>
                                </div>
                            </div>
                            <p class='card-warn-tips'>请检查运营商信息中，是否存在明显的异常信息，包括但不限于 <br>1. 在网时长 < 180 天  <br>2. 180天内活跃天数 < 90天  <br>3. 连续3天非活跃次数 > 10  <br>4. 通话活跃地区与归属地不一致  <br>5. 互通号码数 < 10</p>
                        </div>
                    </div>

                    <div class="card-content" v-if='contactsInfo.hasContacts'>
                        <div class="sub-title"><span class="title">通讯录信息</span></div>
                        <ul class="result-info__list">
                            <li class="result-info__item">
                                <div class="result-info__key">联系人数量</div>
                                <div class="result-info__value">{{contactsInfo.contactNum || placeholder}}</div>
                            </li>
                            <li class="result-info__item">
                                <div class="result-info__key">主要归属地</div>
                                <div class="result-info__value">{{contactsInfo.contactArea || placeholder}}</div>
                            </li>
                            <li class="result-info__item">
                                <div class="result-info__key">与运营商记录匹配度</div>
                                <div class="result-info__value">{{contactsInfo.likeBit || placeholder}}</div>
                            </li>
                        </ul>
                        <div class="card-warn">
                            <div class="card-warn-title">通讯录信息审核成果</div>
                            <div class="card-warn-select">
                                <p>通讯录信息是否存在明显异常</p>
                                <div class="radio">
                                    <radio-group v-model='contactStatus'>
                                        <radio :value='1' >不存在</radio>
                                        <radio :value='0' >存在</radio>
                                    </radio-group>
                                </div>
                            </div>
                            <p class='card-warn-tips'>请检查通讯录信息中，是否存在明显的异常信息，包括但不限于 <br>1. 联系人数量<50  <br>2. 联系人主要归属地与机主归属地不一致  <br>3. 与运营商记录匹配度低于10%</p>
                        </div>
                    </div>

                    <div class="card-content">
                        <div class="sub-title"><span class="title">银行卡绑定信息</span></div>
                        <ul class="result-info__list">
                            <li class="result-info__item">
                                <div class="result-info__key">开户行</div>
                                <div class="result-info__value">{{cardInfo.bankName || placeholder}}</div>
                            </li>
                            <li class="result-info__item">
                                <div class="result-info__key">银行卡号</div>
                                <div class="result-info__value">{{cardInfo.cardNo || placeholder}}</div>
                            </li>
                            <li class="result-info__item">
                                <div class="result-info__key">持卡人</div>
                                <div class="result-info__value">{{cardInfo.userName || placeholder}}</div>
                            </li>
                            <li class="result-info__item">
                                <div class="result-info__key">预留手机号</div>
                                <div class="result-info__value">{{cardInfo.phone || placeholder}}</div>
                            </li>
                        </ul>
                    </div>
            
                    <div class="footer-button" v-if='info.status == "WAITCHECK"'>
                        <!-- <div class="button mid warn">失败</div> -->
                        <div class="button mid error" @click='show_modal_reject = true'>审核拒绝</div>
                        <div class="button mid success" @click='show_confirm_pass = true' :class='{disabled:!allAuth}'>审核通过</div>
                    </div>
                </div>
            </transition>
        </div>

        <modal  
            :show='show_modal_reject' 
            title='拒绝申请'
            :loading='loading_reject'
            @confirm='rejectHandle'
            @close='show_modal_reject=false'>
            <ul class='modal-form'>
                <li class='form-item'>
                    <span class="form-item__key auto red">是否上报风控数据中心</span>
                    <div class="form-item__value">
                        <radio-group v-model='isUpload'>
                            <radio :value='1'>是</radio>
                            <radio :value='0'>否</radio>
                        </radio-group>
                    </div>
                </li>
            </ul>
            <textarea class='modal__textarea' rows="5" placeholder="请输入审核拒绝原因" v-model='rejectReason'></textarea>
        </modal>
        
        <image-view
            v-if='currentImg'
            :show='show_modal_img' 
            :url='currentImg'
            @close='show_modal_img = false'>
        </image-view>

        <modal  
            :show='show_modal_zmxy' 
            title='修改芝麻分'
            :loading='loading_zmxy'
            @confirm='checkZmxy("modify")'
            @close='show_modal_zmxy=false'>
            <ul class='modal-form'>
                <li class='form-item'>
                    <span class="form-item__key">芝麻分</span>
                    <div class="form-item__value">
                        <input type="text" placeholder="请输入芝麻分" v-model='zmScore'>
                    </div>
                </li>
            </ul>
        </modal>

        <confirm
            :show='show_confirm_pass'
            title='确认通过申请'
            :loading='loading_pass'
            @close='show_confirm_pass=false'
            @confirm='pass'>
        </confirm>
    </div>
</template>

<script>
    import { Promise } from 'es6-promise'
    import footerBar from '../components/FooterBar.vue'
    import selectGroup from '../components/SelectGroup.vue'
    import selectOption from '../components/SelectOption.vue'
    import radioGroup from '../components/RadioGroup.vue'
    import datePicker from '../components/DatePicker.vue'
    import areaSelect from '../components/AreaSelect.vue'
    import radio from '../components/Radio.vue'
    import loading from '../components/Loading.vue'
    import tabBox from '../components/TabBox.vue'
    import tab from '../components/Tab.vue'
    import checkBox from '../components/CheckBox.vue'
    import toolTip from '../components/ToolTip.vue'
    import modal from '../components/Modal.vue'
    import imageView from '../components/ImageView.vue'
    import confirm from '../components/Confirm.vue'
    import buttonLoading from '../components/ButtonLoading.vue'
    import pagination from '../components/Pagination.vue'
    import dateFormat from '../filters/filter-dateFormat'
    import toYuan from '../filters/filter-toYuan'
    import  { mapGetters, mapActions }  from 'vuex'
    import { authApplyDetailValidation } from '../validation/validation'
    import { authApi, allApi, lenderApi } from '../api/api'
    import moment from 'moment'


    export default {
        components:{
            footerBar,
            imageView,
            selectGroup,
            selectOption,
            radioGroup,
            tabBox,
            tab,
            radio,
            checkBox,
            areaSelect,
            loading,
            toolTip,
            modal,
            confirm,
            buttonLoading,
            pagination,
            datePicker
        },
        filters:{
            dateFormat,
            toYuan,
            booleanToStr(boolean){
                if(boolean === true){
                    return '是'
                }
                else{
                    return '否'
                }
            }
        },
        data() {
            return {
                id:this.$route.params.id,
                placeholder:'--',
                zmScore:'',
                show_modal_zmxy:false,
                show_modal_reject:false,
                show_confirm_pass:false,
                show_modal_img:false,
                loading_reject:false,
                loading_zmxy:false,
                loading_pass:false,
                loading:false,
                currentImg:'',
                recommend:0,
                curItem:{},
                info:{},
                isUpload:0,
                rejectReason:'',
                basicStatus:'',
                idCardStatus:'',
                mobileStatus:'',
                contactStatus:'',
            }
        },
        computed:{
            ...mapGetters([
                'msgTip',
                'localInfo'
            ]),
            currentPage(){
                if(_.isEmpty(this.listInfo)) return 1
                return this.listInfo.pageNum
            },
            allAuth(){
                let basicPass = this.basicStatus === 1
                let idCardPass = this.idCardStatus === 1
                let mobilePass = this.mobileStatus === 1
                let mobileRisk = this.basicInfo.mobileRisk === false
                let idNumberRisk = this.idCardInfo.idNumberRisk === false
                let callRecordRisk = this.mobileInfo.callRecordRisk === false
                let dubiousDeviceGPSRisk = this.basicInfo.dubiousDeviceGPSRisk && !this.basicInfo.dubiousDeviceGPSRisk.hit
                let normalDeviceGPSRisk = this.basicInfo.normalDeviceGPSRisk && !this.basicInfo.normalDeviceGPSRisk.hit
                let idAddressGPSRisk = this.idCardInfo.idAddressGPSRisk && !this.idCardInfo.idAddressGPSRisk.hit
                let contactPass 
                if(this.contactsInfo.hasContacts){
                    contactPass = this.contactStatus === 1
                }
                else{
                    contactPass = true
                }

                if(basicPass && idCardPass && mobilePass && contactPass && mobileRisk && idNumberRisk && callRecordRisk &&dubiousDeviceGPSRisk && normalDeviceGPSRisk && idAddressGPSRisk) return true

                return false
            },
            basicInfo(){
                return this.info.report && this.info.report.basicInfo || {}
            },
            cardInfo(){
                return this.info.report && this.info.report.cardInfo || {}
            },
            contactsInfo(){
                return this.info.report && this.info.report.contactsInfo || {}
            },
            idCardInfo(){
                return this.info.report && this.info.report.idCardInfo || {}
            },
            deviceConfig(){
                return this.info.report && this.info.report.deviceConfig || {}
            },
            carrierConfig(){
                return this.info.report && this.info.report.carrierConfig || {}
            },
            mobileInfo(){
                return this.info.report && this.info.report.mobileInfo || {}
            },
            noInvoiceInfo(){
                return _.isEmpty(this.invoiceInfo)
            }
        },
        methods:{
            // actions
            ...mapActions([
                'showLoading',
                'hideLoading',
                'setMsgTip'
            ]),

            // filters
            timestampToDate(timestamp){
                if(!timestamp) return this.placeholder
                return moment(timestamp).format('YYYY-MM-DD')
            },

            // function

            setCurrentImg(img){
                this.currentImg = img
                this.show_modal_img = true
            },
            getInfo(){
                this.loading = true
                authApi.detail({
                    id:this.id
                })
                .then(result=>{
                    this.info = result
                    this.basicStatus = this.info.report && this.info.report.basicInfo.status
                    this.idCardStatus = this.info.report && this.info.report.idCardInfo.status
                    this.mobileStatus = this.info.report && this.info.report.mobileInfo.status
                    this.contactStatus = this.info.report && this.info.report.contactsInfo.status
                    this.loading = false
                    console.log(basicStatus)
                    let mobileRisk = this.basicInfo.mobileRisk === true
                    let idNumberRisk = this.idCardInfo.idNumberRisk === true
                    let callRecordRisk = this.mobileInfo.callRecordRisk === true
                    if(mobileRisk || idNumberRisk || callRecordRisk){
                        this.isUpload = 1
                    }
                })
                .catch(error => {
                    console.error(error)
                    this.loading = false
                })
            },
            rejectHandle(){
                let params = {
                    basicStatus:this.basicStatus,
                    idCardStatus:this.idCardStatus,
                    mobileStatus:this.mobileStatus,
                    contactStatus:this.contactStatus,
                }
                if(!authApplyDetailValidation(params)) return

                this.loading = true

                if(this.isUpload){
                    authApi.blackListRiskUpload({
                        id:this.id,
                        idAddressGPSRisk:JSON.stringify(this.idCardInfo.idAddressGPSRisk),
                        normalDeviceGPSRisk:JSON.stringify(this.basicInfo.normalDeviceGPSRisk),
                        dubiousDeviceGPSRisk:JSON.stringify(this.basicInfo.dubiousDeviceGPSRisk),
                        mobileRisk:this.basicInfo.mobileRisk,
                        idnumberRisk:this.idCardInfo.idNumberRisk,
                        mobileRecordRisk:this.mobileInfo.callRecordRisk
                    })
                    .then(result=>{

                    })
                    .catch(error => {
                        console.error(error)
                    })
                }
                authApi.reject({
                    id:this.id,
                    basicStatus:this.basicStatus,
                    idCardStatus:this.idCardStatus,
                    mobileStatus:this.mobileStatus,
                    contactStatus:this.contactStatus,
                    rejectReason:this.rejectReason,
                })
                .then(result=>{
                    this.info = result
                    this.loading = false
                    this.show_modal_reject = false
                    this.$router.back()
                })
                .catch(error => {
                    console.error(error)
                    this.loading = false
                })
            },
            pass(){
                let params = {
                    basicStatus:this.basicStatus,
                    idCardStatus:this.idCardStatus,
                    mobileStatus:this.mobileStatus,
                    contactStatus:this.contactStatus,
                }
                if(!authApplyDetailValidation(params)) return

                this.loading_pass = true
                authApi.pass({
                    id:this.id,
                    basicStatus:this.basicStatus,
                    idCardStatus:this.idCardStatus,
                    mobileStatus:this.mobileStatus,
                    contactStatus:this.contactStatus,
                })
                .then(result=>{
                    this.loading_pass = false
                    this.show_confirm_pass = false
                    this.$router.back()
                })
                .catch(error => {
                    console.error(error)
                    this.loading_pass = false
                })
            },
            checkZmxy(param){
                let score = ''
                if(param){
                    score = this.zmScore
                }
                else{
                    score = this.info.report && this.info.report.zhimaScore
                }
                this.showLoading()
                authApi.zmScoreCheck({
                    id:this.id,
                    zmScore:score
                })
                .then(result=>{
                    this.hideLoading()
                    this.show_modal_zmxy = false
                    this.getInfo()
                })
                .catch(error => {
                    console.error(error)
                    this.hideLoading()
                })
            }
        },
        created(){
            // this.getAccount()
            this.getInfo()
        }
    }
</script>

<style lang="scss">
    @import "../sass/variables";
    @import "../sass/extends";
    @import "../sass/mixins";

    #auth-apply-detail{
        .zmxy{
            display: flex;
            align-items: center;
            padding-top: 10px;
        }
        .zmxy-button{
            display: flex;
            padding-left: 10px;
            .button{
                margin:0 5px;
                padding: 3px 6px;
            }
        }
        .footer-button{
            padding-top: 50px;
            display: flex;
            justify-content: center;
            .button{
                margin:0 20px;
            }
        }
        .threshold{
            color:$red;
            font-weight: normal;
            padding-left: 8px;
        }
        .detail-info{
            font-size: 14px;
            line-height: 1.5;
            padding-top:10px;
            color:$importColor;
            p{
                padding-top: 10px;
            }
            span{
                font-weight: normal;
            }
        }
        .idcard-pics{
            display: flex;
            align-items: center;
            padding-top: 20px;
            .img{
                overflow:hidden;
                display: block;
                width: 30%;
                flex:1;
                position: relative;
                padding-top:25%;
                background-color: $sectionColor;
                img{
                    width: 100%;
                    position: absolute;
                    top:0;
                    left:0;
                }
            }
        }
        .report-warn{
            color:$red;
            font-weight: normal;
        }
    }
</style>
